#include <iostream>

using std::cout;

class Token								//算符类（基类）
{
public:
	virtual bool isOper() = 0;
	virtual void print() = 0;
};

class Oper: public Token				//操作符类
{
public:
	char oper;
	bool isOper()
	{
		return true;
	}
	void print()
	{
		cout << this->oper;
	}
};

class Num: public Token					//操作数类
{
public:
	double value;
	bool isOper()
	{
		return false;
	}
	void print()
	{
		cout << this->value;
	}
};